package com.zl.tesseract.scanner.greendao.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.zl.tesseract.scanner.beans.OutBean;
import com.zl.tesseract.scanner.beans.EnterBean;
import com.zl.tesseract.scanner.beans.CollectBean;

import com.zl.tesseract.scanner.greendao.db.OutBeanDao;
import com.zl.tesseract.scanner.greendao.db.EnterBeanDao;
import com.zl.tesseract.scanner.greendao.db.CollectBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig outBeanDaoConfig;
    private final DaoConfig enterBeanDaoConfig;
    private final DaoConfig collectBeanDaoConfig;

    private final OutBeanDao outBeanDao;
    private final EnterBeanDao enterBeanDao;
    private final CollectBeanDao collectBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        outBeanDaoConfig = daoConfigMap.get(OutBeanDao.class).clone();
        outBeanDaoConfig.initIdentityScope(type);

        enterBeanDaoConfig = daoConfigMap.get(EnterBeanDao.class).clone();
        enterBeanDaoConfig.initIdentityScope(type);

        collectBeanDaoConfig = daoConfigMap.get(CollectBeanDao.class).clone();
        collectBeanDaoConfig.initIdentityScope(type);

        outBeanDao = new OutBeanDao(outBeanDaoConfig, this);
        enterBeanDao = new EnterBeanDao(enterBeanDaoConfig, this);
        collectBeanDao = new CollectBeanDao(collectBeanDaoConfig, this);

        registerDao(OutBean.class, outBeanDao);
        registerDao(EnterBean.class, enterBeanDao);
        registerDao(CollectBean.class, collectBeanDao);
    }
    
    public void clear() {
        outBeanDaoConfig.clearIdentityScope();
        enterBeanDaoConfig.clearIdentityScope();
        collectBeanDaoConfig.clearIdentityScope();
    }

    public OutBeanDao getOutBeanDao() {
        return outBeanDao;
    }

    public EnterBeanDao getEnterBeanDao() {
        return enterBeanDao;
    }

    public CollectBeanDao getCollectBeanDao() {
        return collectBeanDao;
    }

}
